package com.archgeek.rpc.hadoop;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.ipc.RPC;

import java.io.IOException;

/**
 * 服务端
 *
 * @author pizhihui
 * @date 2020-05-15
 */
public class NameNodeRpcServer implements ClientProtocol {


    public void makeDir(String path) {
        System.out.println("服务端: " + path);
    }


    public static void main(String[] args) throws IOException {

        RPC.Server server = new RPC.Builder(new Configuration())
                .setBindAddress("localhost")
                .setPort(9999)
                .setProtocol(ClientProtocol.class)
                .setInstance(new NameNodeRpcServer())
                .build();

        server.start();

    }
}
